<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
  <head>
    <title>Create a Great Wall Account</title>
  </head>
  <header>
      <jsp:include page="header.jsp"/>
  </header>
  <body>
    <table width="100%">
    <td width="90%"><label style="color:green;font-size:large">Get Started with The Great Wall</label></td>
    <td><a href="./walls">Home</a></td>
    </table>

   <c:set var="u" value="${user}"/>
   <c:if test="${not empty errors}">
    <ul style="font-weight:normal;color:red">
        <c:forEach var="e" items="${errors}">
            <li><c:out value="${e}"></c:out></li>
        </c:forEach>
    </ul>
    </c:if>
    
    <c:if test="${empty sessionScope.username}">
    <form name="addUserForm" action="./adduser" method="POST">
    <table width="100%" cellpadding="1" cellspacing="1">
        <tr>
            <td width="20%">First name:</td>
            <td width="80%"><input type="text" name="fname" size="23" maxlength="30"  value="${u.firstName}"></td>
        </tr>

        <tr>
            <td>Last name:</td>
            <td><input type="text" name="lname" size="23" maxlength="30" value="${u.lastName}"></td>
        </tr>

        <tr>
            <td>Email:</td>
            <td><input type="text" name="email" size="23" maxlength="30" value="${u.email}"></td>
        </tr>

        <tr>
            <td>Desired Login Name:</td>
            <td><input type="text" name="username" size="23" maxlength="20" value="${u.userName}"></td>
        </tr>

        <tr>
            <td>Choose a password:</td>
            <td><input type="password" name="password" size="23" maxlength="30" value="${u.password}"></td>
        </tr>

        <tr></tr>
        
        <tr>
            <td></td>
            <td><input style="width:12em" type="submit" name="submitButton"
            value="Create my Account" size="30"></td>
        </tr>
        
    </table>
    </form>
    </c:if>
    <footer>
        <jsp:include page="footer.jsp"/>
    </footer>
  </body>
</html>
